/*     */ package com.lmpop.trade.ts_custclass;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ts_custclassInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ts_custclassInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Ts_custclass ts_custclass = new Ts_custclass();
/*  25 */     ts_custclass.setCust_class(map.getString("cust_class"));
/*  26 */     ts_custclass.setCust_class_name(map.getString("cust_class_name"));
/*  27 */     ts_custclass.setClass_type(map.getString("class_type"));
/*  28 */     ts_custclass.setCust_oper_person(map.getString("cust_oper_person"));
/*  29 */     ts_custclass.setCust_oper_date(map.getString("cust_oper_date"));
/*  30 */     ts_custclass.setRemark(map.getString("remark"));
/*     */ 
/*  32 */     String result_code = "0";
/*     */     try {
/*  34 */       insert(dbmMgr, ts_custclass);
/*     */     } catch (ApplicationException e) {
/*  36 */       e.printStackTrace();
/*  37 */       result_code = "1";
/*     */     }
/*  39 */     map.setString("result_code", result_code);
/*  40 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ts_custclass ts_custclass)
/*     */     throws ApplicationException
/*     */   {
/*  49 */     dbmMgr.update("insertTs_custclass", ts_custclass);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  59 */     String pkid_string = map.getString("pkid");
/*  60 */     String result_code = "0";
/*     */     try {
/*  62 */       if (!pkid_string.equals("")) {
/*  63 */         String[] pkStr = pkid_string.split("\\|");
/*  64 */         for (int i = 0; i < pkStr.length; i++) {
/*  65 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  69 */       e.printStackTrace();
/*  70 */       result_code = "1";
/*     */     }
/*  72 */     map.setString("result_code", result_code);
/*  73 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  82 */     dbmMgr.update("deleteTs_custclass", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  91 */     Ts_custclass ts_custclass = new Ts_custclass();
/*  92 */     ts_custclass.setCust_class(map.getString("cust_class"));
/*  93 */     if (map.getString("cust_class_name") != null)
/*  94 */       ts_custclass.setCust_class_name(map.getString("cust_class_name"));
/*  95 */     if (map.getString("class_type") != null)
/*  96 */       ts_custclass.setClass_type(map.getString("class_type"));
/*  97 */     if (map.getString("cust_oper_person") != null)
/*  98 */       ts_custclass.setCust_oper_person(map.getString("cust_oper_person"));
/*  99 */     if (map.getString("cust_oper_date") != null)
/* 100 */       ts_custclass.setCust_oper_date(map.getString("cust_oper_date"));
/* 101 */     if (map.getString("remark") != null) {
/* 102 */       ts_custclass.setRemark(map.getString("remark"));
/*     */     }
/* 104 */     String result_code = "0";
/*     */     try {
/* 106 */       update(dbmMgr, ts_custclass);
/*     */     } catch (ApplicationException e) {
/* 108 */       e.printStackTrace();
/* 109 */       result_code = "1";
/*     */     }
/* 111 */     map.setString("result_code", result_code);
/* 112 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ts_custclass ts_custclass)
/*     */     throws ApplicationException
/*     */   {
/* 121 */     dbmMgr.update("updateTs_custclass", ts_custclass);
/*     */   }
/*     */ 
/*     */   public SysMap updateAll(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 130 */     String pkid_string = map.getString("pkid");
/* 131 */     String result_code = "0";
/*     */     try {
/* 133 */       if (!pkid_string.equals("")) {
/* 134 */         String[] pkStr = pkid_string.split("\\|");
/* 135 */         for (int i = 0; i < pkStr.length; i++)
/* 136 */           if (!pkStr[i].equals("")) {
/* 137 */             Map ts_custclass = new Hashtable();
/* 138 */             String[] cust_class_string = pkStr[i].split("\\,");
/* 139 */             ts_custclass.put("cust_class", cust_class_string[0]);
/* 140 */             ts_custclass.put("cust_class_name", cust_class_string[1]);
/* 141 */             ts_custclass.put("class_type", cust_class_string[2]);
/* 142 */             ts_custclass.put("cust_type", cust_class_string[3]);
/*     */ 
/* 144 */             updateAll(dbmMgr, ts_custclass);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e) {
/* 149 */       e.printStackTrace();
/* 150 */       result_code = "1";
/*     */     }
/* 152 */     map.setString("result_code", result_code);
/* 153 */     return map;
/*     */   }
/*     */   public void updateAll(DbmInterf dbmMgr, Map ts_custclass) throws ApplicationException {
/* 156 */     dbmMgr.update("updateTs_custclass_all", ts_custclass);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 167 */     Map ts_custclass = (Hashtable)obj;
/* 168 */     if (start == 0)
/* 169 */       start = 0;
/*     */     else {
/* 171 */       start = (start - 1) * limit;
/*     */     }
/* 173 */     ts_custclass.put("start", Integer.valueOf(start));
/* 174 */     ts_custclass.put("limit", Integer.valueOf(limit));
/* 175 */     return this.queryList.getList("getListByTs_custclassPage", ts_custclass);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 186 */     Map ts_custclass = (Hashtable)obj;
/* 187 */     List list = this.queryList.getList("getCountByObjTs_custclass", obj);
/* 188 */     int count = 0;
/* 189 */     if ((list != null) && (list.size() > 0)) {
/* 190 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 191 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 192 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 195 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 205 */     return this.queryList.getList("getTs_custclassByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getSelectString(Object obj, String cust_class_params)
/*     */   {
/* 216 */     Map ts_custclass = (Hashtable)obj;
/* 217 */     List list = this.queryList.getList("getListByTs_custclassPage", ts_custclass);
/* 218 */     String selectString = "";
/* 219 */     String cust_class = "";
/* 220 */     String cust_class_name = "";
/* 221 */     if ((list != null) && (list.size() > 0)) {
/* 222 */       for (int i = 0; i < list.size(); i++) {
/* 223 */         Hashtable newsMap = (Hashtable)list.get(i);
/* 224 */         if ((newsMap.get("cust_class") != null) && (!newsMap.get("cust_class").toString().equals(""))) {
/* 225 */           cust_class = newsMap.get("cust_class").toString();
/*     */         }
/* 227 */         if ((newsMap.get("cust_class_name") != null) && (!newsMap.get("cust_class_name").toString().equals(""))) {
/* 228 */           cust_class_name = newsMap.get("cust_class_name").toString();
/*     */         }
/* 230 */         if (cust_class.equals(cust_class_params))
/* 231 */           selectString = selectString + "<option value='" + cust_class + "'selected>" + cust_class_name + "</option>";
/*     */         else {
/* 233 */           selectString = selectString + "<option value='" + cust_class + "'>" + cust_class_name + "</option>";
/*     */         }
/*     */       }
/*     */     }
/* 237 */     return selectString;
/*     */   }
/*     */ 
/*     */   public String getcust_class_name(String cust_class_params)
/*     */   {
/* 248 */     List list = this.queryList.getList("getcust_class_name", cust_class_params);
/* 249 */     String cust_class_name = "";
/* 250 */     if ((list != null) && (list.size() > 0))
/*     */     {
/* 252 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 253 */       if ((newsMap.get("cust_class_name") != null) && (!newsMap.get("cust_class_name").toString().equals(""))) {
/* 254 */         cust_class_name = newsMap.get("cust_class_name").toString();
/*     */       }
/*     */ 
/*     */     }
/*     */ 
/* 259 */     return cust_class_name;
/*     */   }
/*     */ 
/*     */   public Map getCust_classname() {
/* 263 */     List list = this.queryList.getList("getTs_custclass");
/* 264 */     Map maps = new Hashtable();
/* 265 */     String cust_class = "";
/* 266 */     String cust_class_name = "";
/* 267 */     if ((list != null) && (list.size() > 0)) {
/* 268 */       for (int i = 0; i < list.size(); i++) {
/* 269 */         Hashtable newsMap = (Hashtable)list.get(i);
/* 270 */         if ((newsMap.get("cust_class") != null) && (!newsMap.get("cust_class").toString().equals(""))) {
/* 271 */           cust_class = newsMap.get("cust_class").toString();
/*     */         }
/* 273 */         if ((newsMap.get("cust_class_name") != null) && (!newsMap.get("cust_class_name").toString().equals(""))) {
/* 274 */           cust_class_name = newsMap.get("cust_class_name").toString();
/*     */         }
/* 276 */         maps.put(cust_class, cust_class_name);
/*     */       }
/*     */     }
/* 279 */     return maps;
/*     */   }
/*     */   public Boolean checkCustClass(String cust_class) {
/* 282 */     List list = this.queryList.getList("ts_custclass_checkCustClass", cust_class);
/* 283 */     if ((list != null) && (list.size() > 0)) {
/* 284 */       return Boolean.valueOf(true);
/*     */     }
/* 286 */     return Boolean.valueOf(false);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ts_custclass.Ts_custclassInfo
 * JD-Core Version:    0.6.0
 */